import request from '@/utils/request';

// 商品管理
export const goodsList = (data) => {
  return request({
    url: '/console/shopGoods/list',
    method: 'POST',
    data,
  })
}
// (添加/修改)商品
export const goodsSave = (data) => {
  return request({
    url: '/console/shopGoods/save',
    method: 'POST',
    data,
  })
}
// 导出商品管理
export const exportGoods = (data) => {
  return request({
    url: '/console/shopGoods/exportGoods',
    method: 'POST',
    responseType: 'blob',
    data,
  })
}
// 商品修改回显数据
export const editDetail = (data) => {
  return request({
    url: '/console/shopGoods/editDetail',
    method: 'POST',
    data,
  })
}
// 删除
export const deleteGoods = (data) => {
  return request({
    url: '/console/shopGoods/delete',
    method: 'POST',
    data,
  })
}
// 上下架
export const editStatus = (data) => {
  return request({
    url: '/console/shopGoods/editStatus',
    method: 'POST',
    data,
  })
}
// 申请新品列表
export const goodsApplyList = (data) => {
  return request({
    url: '/console/applyNew/list',
    method: 'POST',
    data,
  })
}
// 导出新品列表
export const exportGoodsApply = (data) => {
  return request({
    url: '/console/applyNew/export',
    method: 'POST',
    responseType: 'blob',
    data,
  })
}
// 拒绝新品
export const rejectGoodsApply = (data) => {
  return request({
    url: '/console/applyNew/fail',
    method: 'POST',
    data,
  })
}
// 通过申请新品
export const passGoodsApply = (data) => {
  return request({
    url: '/console/applyNew/pass',
    method: 'POST',
    data,
  })
}

// 心愿单排行
export const collectRanking = (data) => {
  return request({
    url: '/shop/goods/collectRanking',
    method: 'POST',
    data,
  })
}
// 爆款商机
export const goodsHot = (data) => {
  return request({
    url: '/shop/goods/hot',
    method: 'POST',
    data,
  })
}


// 心愿单排行
export const collectRankingList = (data) => {
  return request({
    url: '/console/shopGoods/collectionList',
    method: 'POST',
    data,
  })
}
// 导出心愿单排行
export const exportCollectRanking = (data) => {
  return request({
    url: '/console/shopGoods/exportCollectionList',
    method: 'POST',
    responseType: 'blob',
    data,
  })
}

// 品牌数据
export const brandList = (data) => {
  return request({
    url: '/console/shopGoods/brandsData',
    method: 'POST',
    data,
  })
}